import { createRouter, createWebHistory } from 'vue-router'
import Gallery from '../views/Gallery.vue'  // 画廊页面
import Index from '../views/Index.vue'      // 首页
import Video from '../views/Video.vue'      // 视频页面
import Music from '../views/Music.vue'      // 音乐页面
import About from '../views/About.vue'      // 关于我们页面
import Profile from '../views/Profile.vue'  // 个人中心页面
import VideoDetail from '../views/VideoDetail.vue' // 视频详情页面
import Search from '../views/Search.vue'    // 搜索结果页面
import SplashScreen from '../components/SplashScreen.vue' // 启动页
import MainContent from '../components/MainContent.vue' // 主内容页面（带导航）

// 导入不包含底部的新页面组件
import MusicNoFooter from '../views/MusicNoFooter.vue'
import VideoNoFooter from '../views/VideoNoFooter.vue'
import GalleryNoFooter from '../views/GalleryNoFooter.vue'

const routes = [
  {
    path: '/',
    name: 'SplashScreen',
    component: SplashScreen  // 启动页
  },
  {
    path: '/main',
    name: 'Main',
    component: MainContent,  // 主内容页面（带导航）
    children: [
      {
        path: '',
        name: 'Home',
        component: Index  // 默认首页
      },
      {
        path: 'home',
        name: 'HomeChild',
        component: Index  // 首页
      },
      {
        path: 'gallery',
        name: 'Gallery',
        component: GalleryNoFooter  // 画廊页面（无底部）
      },
      {
        path: 'video',
        name: 'Video',
        component: VideoNoFooter  // 视频页面（无底部）
      },
      {
        path: 'video/:id',
        name: 'VideoDetail',
        component: VideoDetail  // 视频详情页面
      },
      {
        path: 'music',
        name: 'Music',
        component: MusicNoFooter  // 音乐页面（无底部）
      },
      {
        path: 'about',
        name: 'About',
        component: About  // 关于我们页面
      },
      {
        path: 'profile',
        name: 'Profile',
        component: Profile  // 个人中心页面
      },
      {
        path: 'search',
        name: 'Search',
        component: Search  // 搜索结果页面
      }
    ]
  },
  // 添加不包含底部的独立页面路由
  {
    path: '/music-no-footer',
    name: 'MusicNoFooter',
    component: MusicNoFooter
  },
  {
    path: '/video-no-footer',
    name: 'VideoNoFooter',
    component: VideoNoFooter
  },
  {
    path: '/gallery-no-footer',
    name: 'GalleryNoFooter',
    component: GalleryNoFooter
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router